﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace UIWindows.Tools.Converter
{
    public class StatusConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            //设备状态 0:待机、1:运行、2:故障、3:报警(运行,停止,报警)
            return value?.ToString() switch
            {
                "0" => "待机",
                "1" => "运行中",
                "2" => "故障",
                "3" => "报警",
                _ => "未连接"
            };
  
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
